<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <link rel="stylesheet" href="../css/animate.css">
    <style>
        .p1 {
            width: 200px;
            height: 200px;
            background-color: red;
            margin: 0 auto;
        }
    </style>
</head>

<body>
    <div id="app">
        <button @click="flag=!flag">点击</button>

        <transition enter-active-class="animate__fadeInLeft" 
            leave-active-class="animate__fadeOutRight">
            <p class="p1" v-show="flag"></p>
        </transition>

        <p class="animate__animated animate__fadeInLeft" v-show="flag">
            我真的服了捏</p>

    </div>
   
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            flag: false
        }
    })
</script>
</html>